<body class="avoid-fout">
	<header class="header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo" href="/">{{ global_title }}</a>
        {% if user.is_anonymous %}
        <ul class="nav nav-list pull-right">
            <li>
                <a class="btn btn-yellow waves-button waves-effect waves-light" href="{% url 'accounts:register' %}">注册</a>
            </li>
        </ul>
        <ul class="nav nav-list pull-right">
            <li>
                <a class="btn btn-blue waves-button waves-effect waves-light" href="{% url 'accounts:login' %}">登陆</a>
            </li>
        </ul>
        {% else %}
        <a class="header-logo" href="{% url 'article:new_article' %}">新建文章 <small>(New Article)</small></a>
		<ul class="nav nav-list pull-right">
			<li>
				<a data-toggle="menu" href="#profile">
					<span class="access-hide">{{ user.username}}</span>
					<span class="avatar"><img alt="{{ user.username }}" src="{{ user.avatar }}"></span>
				</a>
			</li>
		</ul>
        {% endif %}
	</header>
	<nav class="menu" id="menu">
		<div class="menu-scroll">
			<div class="menu-wrap">
				<div class="menu-content">
                    <div class="form-group-colour">
                        <form action="{% url 'article:search_article' %}" method="get">
                            <div class="row">
                                <div class="col-md-12">
                                    <input class="form-control" placeholder="输入你想搜索的内容" name="q" type="search">
                                </div>
                            </div>
                        </form>
                    </div>
					<a class="menu-logo" href="/">{{ global_title }}</a>
					<ul class="nav">
						<li>
							<a href="{% url 'article:all_articles' %}">全部文章<small>(all Article)</small></a>
						</li>
						<li>
							<a href="http://rrrrat.email/" target="_blank">资讯<small>(News)</small></a>
						</li>
                        <li>
							<a href="javascript:void(0)">分类<small>(Category)</small></a>
							<span class="menu-collapse-toggle collapsed" data-target="#page-palettes" data-toggle="collapse"><i class="icon menu-collapse-toggle-close">close</i><i class="icon menu-collapse-toggle-default">add</i></span>
							<ul class="menu-collapse collapse" id="page-palettes">
                                {% for category in categorys %}
								<li>
									<a href="{% url 'article:category' id=category.id %}">{{ category.name}}</a>
								</li>
                                {% endfor %}
							</ul>
						</li>
                        <li>
                            <a href="{% url 'home_page:timeline' %}">时间线<small>(Time Line)</small></a>
						</li>
					</ul>
                    <hr>
					<ul class="nav">
                        <li>
                            <a href="javascript:void(0)">关于我<small>(About Me)</small></a>
						</li>
                        <hr>
						<li>
                            <a href="javascript:void(0)">友情链接<small>(Links)</small></a>
						</li>
						<li>
                            <a href="http://rrrrat.email/" target="_blank"><small>rwwww.cn</small></a>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</nav>

	<nav class="menu menu-right" id="profile">
		<div class="menu-scroll">
			<div class="menu-wrap">
				<div class="menu-top">
					<div class="menu-top-img">
						<img alt="{{ global_title }}" src="/static/images/samples/landscape.jpg">
					</div>
					<div class="menu-top-info">
						<a class="menu-top-user" href="javascript:void(0)"><span class="avatar pull-left"><img alt="{{ user.username }}" src="{{ user.avatar }}"></span>{{ user.username }}</a>
					</div>
					<div class="menu-top-info-sub">
						<small>{{ user.introduction }}</small>
					</div>
				</div>
				<div class="menu-content">
					<ul class="nav">
						<li>
                            <a href="{% url 'accounts:profile_edit' %}"><span class="icon icon-lg">account_box</span>用户信息<small> (User Profile)</small></a>
						</li>
						<li>
                            <a href="{% url 'accounts:upload_photo' %}"><span class="icon icon-lg">add_to_photos</span>头像上传<small> (Upload Photo)</small></a>
						</li>
						<li>
							<a href="{% url 'accounts:logout' %}"><span class="icon icon-lg">exit_to_app</span>登出<small> (Logout)</small></a>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</nav>